package org.bot.http.event;

import org.bot.api.event.DataStorage;
import org.bot.api.event.EventName;
import org.bot.api.event.Events;
import org.bot.api.flow.FlowNode;
import org.bot.http.client.HttpTool;
import org.springframework.stereotype.Component;

/**
 * @author 沧月
 * @create 0011 2023/10/11 16:31
 * @description <站外下载文件>
 */
@Component
@EventName("下载文件（站外）")
public class ClientHttpDownload implements Events {

    @Override
    public Object exec(FlowNode note, DataStorage data) {
        return HttpTool.downloadFile(data.get(note.getDataIndex()).toString());
    }
}
